package day240510.p1;

import day240510.p1.Everything;

public class Student extends Everything {
    String name;
    int score;

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }

    @Override
    public int compareTo(Everything everything) {Student student = (Student) everything;
        if (this.score > student.score) {
            return 1;
        } else if (this.score < student.score) {
            return -1;
        } else {
            return 0;
        }
    }
}
